package 设计模式.r_状态模式;

import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.log.StaticLog;

/**
 * @author caihe
 * @date 2023/3/22 14:31
 */
public class CloseElevator implements ElevatorState {
    @Override
    public void open(Elevator elevator) {
        StaticLog.info("关闭电梯门的过程中，按下开电梯中断关闭...打开中...");
        ThreadUtil.sleep(1000);
        StaticLog.info("电梯门打开完成，乘客已进出完毕电梯自动关闭");
    }

    @Override
    public void close(Elevator elevator) {
        StaticLog.info("按下关电梯...关闭中...");
        ThreadUtil.sleep(1000);
        StaticLog.info("电梯门关闭完成，更换状态为move");
        elevator.setState(new MoveElevator());
    }

    @Override
    public void move(Elevator elevator) {

    }

    @Override
    public void stop(Elevator elevator) {

    }
}
